package org.example;

import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;
import java.util.List;

public class sparkY1 {
    public static void main(String[] args) {
        //创建一个spark的运行环境
        final JavaSparkContext sc = new JavaSparkContext("local","spark");
        final List<Integer> nums = Arrays.asList(1,2,3,4,5,6);
        final JavaRDD<Integer> rdd = sc.parallelize(nums);
        System.out.println(rdd.partitions().size());

        final JavaRDD<String> rddTest = sc.textFile("C:\\Users\\Administrator\\Desktop\\word.txt");



        //释放资源
        sc.close();

    }
}
